package com.mfangsoft.zhuangjialong.integration.usermanage.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.mfangsoft.zhuangjialong.common.model.Page;
import com.mfangsoft.zhuangjialong.common.utils.stereotype.WriterRepository;
import com.mfangsoft.zhuangjialong.integration.usermanage.model.SellerPointEntity;
@WriterRepository
public interface SellerPointEntityMapper {
    /**
     * 通过主键删除  
     *
     * @MLTH_generated
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 插入数据  
     *
     * @MLTH_generated
     */
    int insert(SellerPointEntity record);

    int insertSelective(SellerPointEntity record);

    /**
     * 通过主键查询数据 
     *
     * @MLTH_generated
     */
    List<SellerPointEntity> selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SellerPointEntity record);

    /**
     * 通过主键更新数据  
     *
     * @MLTH_generated
     */
    int updateByPrimaryKey(SellerPointEntity record);

    /**
     * 根据导购的id查询他所有的积分
     * @param page
     * @return
     */
	List<SellerPointEntity> selectIntegralsByUserManagerIdForPage(Page<SellerPointEntity> param);

	/**
	 * 根据导购的id查看导购的总积分
	 * @param userManagerId
	 * @return
	 */
	Integer selectUserManagerIntegral(Long userManagerId);

	/**
	 * 导购积分管理列表
	 * @param param
	 * @return
	 */
	List<SellerPointEntity> selectUserManagerIntegralManagementForPage(Page<SellerPointEntity> param);
	
    /**
    * 查看是否是第一次分享
    * @param seller_id
    */
	int selectIsFirstShareBySellerId(Long seller_id);

	/**
	 * 查看是否是第一次添加沟通记录
	 * @param userManager_id
	 * @return
	 */
	int selectIsFirstAddByUserManagerId(@Param(value = "userManager_id") Long userManager_id,@Param(value = "type_index") Integer type_index);

	/**
	 * 查询导购签到
	 * @param userManagerId
	 * @param type_index
	 * @return
	 */
	SellerPointEntity selectByUserManagerIdAndTypeIndex(@Param(value = "userManager_id") Long userManagerId,@Param(value = "type_index") int type_index);
}